home *** CD-ROM | disk | FTP | other *** search
- % -----------------------------------------------------------------------------
- % Array demo *TERMINATE PRESCRIPTION*
- % -----------------------------------------------------------------------------
- %
- % Version : 1.00
- % Filename : ARRAY.TSL
- % Company : SerWiz Comm
- % Programmer : Bo Bendtsen
- % Module created : 28 Apr 1996
- % Latest revision : 28 Apr 1996
- % Language/version : Terminate Prescription 1.01
- % Remarks : Demonstration of how to use arrays
- %
- % -----------------------------------------------------------------------------
-
- InitArray 1,500,100 % Reserve 50000 bytes for array 1
- % 1-32 can be used as arrays
- % Elements = 500
- % Each element = 100 bytes
- % Max array size = 65000
-
- If DosError=0 % Check if array was initialised
- PrintLn "Could not initialise array"
- Terminate
- Endif
-
- Set LineCount=0 % Read CONFIG.SYS into array 1
- OpenText 1,"C:\CONFIG.SYS",0
- While EndofTextFile(1)=0
- Set LineCount=LineCount+1
- PutArray 1,LineCount,readtext(1)
- EndWhile
- CloseText 1
-
- For Count,1,LineCount,1 % Show CONFIG.SYS on screen
- PrintLn GetArray(1,Count)
- Next
-
- FreeArray 1 % Free memory again
-
-